﻿using DevExpress.XtraEditors;
using DXApplicationTangche.UC.报表.service;
using DXApplicationTangche.UC.订单.service;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static DXApplicationTangche.UC.订单.service.ViewSemiCheckExceptionDao;

namespace DXApplicationTangche.UC.报表
{
    public partial class Form有赞发货分拣程序 : DevExpress.XtraEditors.XtraForm
    {
        public Form有赞发货分拣程序()
        {
            InitializeComponent();
            this.refreshata();
        }

        private void refreshata()
        {
            List<YouzanGoodsOrderDTO> youzanGoodsOrderDTOs = 抖音客户Service.getYouzanGoodsOrderDTO();
            //  去掉详细地址中的省市县
            this.cleanYouzanGoodsOrderDTO(youzanGoodsOrderDTOs);

            this.gridControl分拣.DataSource = youzanGoodsOrderDTOs;
            this.advBandedGridView分拣.RefreshData();
        }

        /// <summary>
        /// 去掉详细地址中的省市县和“，”
        /// </summary>
        /// <param name="youzanGoodsOrderDTOs"></param>
        private void cleanYouzanGoodsOrderDTO(List<YouzanGoodsOrderDTO> youzanGoodsOrderDTOs)
        {
            List<xxx> x = new List<xxx>();

            x.Add(new xxx("18902186331", "王嘉智"));


            Dictionary<String, String> dict = new Dictionary<string, string>();
            foreach (xxx xxx in x) {
                dict.Add(xxx.mobile, xxx.name);
            }



            foreach (YouzanGoodsOrderDTO youzanGoodsOrderDTO in youzanGoodsOrderDTOs)
            {
                youzanGoodsOrderDTO
                    .buildAddress() //  修改地址
                    .build(dict); //  改名
            }
        }
    }

}